package com.aaa.controller;

import com.aaa.utils.UploadUtil;
import com.aaa.vo.Result;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;

/**
 * 上传控制器
 * -*- coding:utf-8 -*-
 *
 * @author 太阳偷渡青山
 * @software IntelliJ IDEA
 * @date 2022/09/28 22:04
 * @Description
 */
@Controller
@RequestMapping("/upload")
public class UploadController {
    @RequestMapping("/sure")
    @ResponseBody
    public Result<String> upload(MultipartFile file) {
        String url = UploadUtil.uploadOOS(file);
        return Result.success(url, "上传成功");
    }
}